package designpattern.observer.mq;

import java.util.concurrent.CompletableFuture;

/**
 * 库存观察者
 * @param <E>
 */
public class StockObserver<E> extends Observer<E> {
    @Override
    void handEvent(E event) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                deductInventory(event);
            }
        }).start();
    }

    private void deductInventory(E o){
        System.out.println("扣减库存");
    }
}
